<?php
$_SESSION['page'] = 'home';
$photolist = '';
$photorows = Db::getRows('*', 'photo');
foreach ($photorows as $photorow) {
    $photolist .= '<div class="photos">
                <div class="img">
                    <a class="light" href="../upload/'.$photorow['name'].'"><img src="../upload/'.$photorow['name'].'"></a>
                </div>
                <a onclick="return confirm(\'Bạn có chắc chắn muốn xóa?\')" href="photos?did='.$photorow['id'].'">xóa</a>
            </div>';
}
$photolist = $photolist == '' ? '<tr><td colspan="3">Chưa có ảnh</td></tr>': $photolist;

$nationlist = '';
$rows = Db::getRows('*', 'nation order by vitri');
foreach ($rows as $value => $row) {
    $nationlist .= '<tr><td>'.++$value.'</td><td id="name'.$row['id'].'">'.$row['name'].'</td><td id="nameen'.$row['id'].'">'.$row['name2'].'</td><td id="vt'.$row['id'].'">'.$row['vitri'].'</td><td><a class="btBlue" id="'.$row['id'].'">
                          <span>
                              <span>Sửa</span>
                          </span>
                      </a><a onclick="return confirm(\'Bạn có chắc chắn muốn xóa?\')" href="nation?did='.$row['id'].'" class="btPink">
                          <span>
                              <span>Xóa</span>
                          </span>
                      </a></td></tr>';
}
$nationlist = $nationlist == '' ? '<tr><td colspan="3">Chưa có dữ liệu</td></tr>': $nationlist;
?>
